home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / windows4 / splash.zip / ZWINDOW.PAS < prev   
Pascal/Delphi Source File  |  1992-03-14  |  2KB  |  85 lines

  1.  
  2. {   This program demonstates the use of a        }
  3. {   bitmap splash screen that appears upon       }
  4. {   loading the program for a period of ten      }
  5. {   seconds.                                     }
  6. {   Copyright 1992, SJHDesign                    }
  7.  
  8.  
  9. program ZWindow;
  10.  
  11. {$R zilch.res}
  12.  
  13. uses WObjects, WinTypes, WinProcs, Splash;
  14.  
  15. const
  16.   menu_File = 0;
  17.   id_menu =100;
  18.   id_icon = 'ZILCHICON';
  19.   cm_About = 101;
  20.   cm_Quit = 103;
  21.  
  22. type
  23.  
  24.   { Declare TZilchApp, a TApplication descendant }
  25.   ZilchApplication = object(TApplication)
  26.     procedure InitMainWindow; virtual;
  27.   end;
  28.  
  29.   { Declare TZilchWindow, a TWindow descendant }
  30.   PZilchWindow = ^TZilchWindow;
  31.   TZilchWindow = object(TWindow)
  32.     constructor Init(AParent: PWindowsObject; ATitle: PChar);
  33.     procedure CMAbout(var Msg: TMessage);
  34.       virtual cm_First + cm_About;
  35.     procedure GetWindowClass(var AWndClass: TWndClass); virtual;
  36.     procedure CMQuit(var Msg: TMessage);
  37.       virtual cm_First + cm_Quit;
  38.   end;
  39.  
  40. { Construct a TWindow object, loading its menu }
  41. constructor TZilchWindow.Init(AParent: PWindowsObject; ATitle: PChar);
  42. begin
  43.   TWindow.Init(AParent, ATitle);
  44.   Attr.Menu := LoadMenu(HInstance, PChar(id_menu));
  45. end;
  46.  
  47. procedure TZilchWindow.GetWindowClass(var AWndClass: TWndClass);
  48. begin
  49.   TWindow.GetWindowClass(AWndClass);
  50.   AWndClass.HIcon := LoadIcon(HInstance, 'APPICON')
  51. end;
  52.  
  53. procedure TZilchWindow.CMQuit(var Msg: TMessage);
  54. begin
  55.    TWindow.CloseWindow;
  56. end;
  57.  
  58. procedure TZilchWindow.CMAbout(var Msg: TMessage);
  59. var
  60.   Dialog:TDialog;
  61. begin
  62.   Dialog.Init(@Self, 'About');
  63.   Dialog.Execute;
  64.   Dialog.Done
  65. end;
  66.  
  67. { Construct the TZilchApp's MainWindow of type TWindow }
  68. procedure ZilchApplication.InitMainWindow;
  69. begin
  70.   MainWindow := New(PZilchWindow, Init(nil, 'SplashScreen Demo'));
  71. end;
  72.  
  73.   { Declare a variable of type TFileApp }
  74. var
  75.   ZilchApp : ZilchApplication;
  76.  
  77. { Run the FileApp }
  78. begin
  79.   ZilchApp.Init('ZilchApp');
  80.   Application^.MakeWindow(New(PPicWindow, Init(nil, ws_Popup or ws_visible
  81.     and not ws_OverlappedWindow)));
  82.   ZilchApp.Run;
  83.   ZilchApp.Done;
  84. end.
  85.